-
Notifications
You must be signed in to change notification settings - Fork 26
Setup GUI testing #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…modern-python-and-pyqt6 Add Basler and GenTL camera backends for modular capture
…era-functionality
…camera-functionality Rework layout and camera handling controls
…' into artur/test_update
…r integration - Implemented `get_device_count` method in `GenTLCameraBackend` to retrieve the number of GenTL devices detected. - Added `max_devices` configuration option in `CameraSettings` to limit device probing. - Introduced `BoundingBoxSettings` for bounding box visualization, integrated into the main GUI. - Enhanced `DLCLiveProcessor` to accept a processor instance during configuration. - Updated GUI to support processor selection and auto-recording based on processor commands. - Refactored camera properties handling and removed deprecated advanced properties editor. - Improved error handling and logging for processor connections and recording states.
Co-authored-by: Copilot <[email protected]>
… options to config
- Update configuration settings to include support for single-animal models in DLCProcessorSettings. - Improve user guide with a link to DLC documentation for model export.
…le_animal in DLCLiveProcessor settings
- Implemented MultiCameraController to manage multiple cameras simultaneously.
…fix for basler backend
…me data without tiling and track source camera ID
…ulti-camera controller
MainWindow now accepts optional MultiCameraController, DLCLiveProcessor, and recorder_factory for improved testability and flexibility. Added a property for accessing and setting the processor in DLCLiveProcessor. Timer intervals are now stored as instance variables for easier configuration.
Replaces direct VideoRecorder instantiation with a recorder factory in MainWindow for improved flexibility. Updates pyproject.toml to add pytest-env, set additional pytest options, and configure environment variables for headless GUI testing.
Introduces a new 'dlclivegui_tests' directory containing fixtures, fake camera and DLCLive stubs, and end-to-end/integration tests for GUI and backend components. Updates .gitignore to allow test files and adjusts pytest configuration to use the new test directory. This enables robust, hardware-independent testing of the application's core logic and GUI.
Introduces a GitHub Actions workflow to run tests across multiple OSes and Python versions, with optional Xvfb support for Linux GUI tests. Adds a tox.ini configuration to define test environments for running all, GUI-only, or non-GUI tests. Also adds a pragma to a test exception handler to improve coverage reporting.
Introduces steps to upload the HTML coverage report as an artifact and append a coverage summary to the GitHub Actions job summary. This enhances test visibility and makes coverage results more accessible directly from the workflow.
To avoid tensorflow binaries issues that should be handled in DLCLive and not here, we skip installing it to instead focus on the GUI itself. Reorganize testenv sections to explicitly install dependencies and avoid installing runtime deps like deeplabcut-live. Add skip_install and commands_pre to base env, clarify descriptions, and streamline dependency management for GUI and non-GUI test environments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Sets up a comprehensive end-to-end testing pipeline for basic GUI functions using pytest, pytest-qt, and tox. The PR establishes fixtures for cameras and DLCLive to enable testing of MultiCameraController, DLCProcessor, and gui.MainWindow without requiring actual hardware or trained models.
Changes:
- Added test infrastructure with pytest configuration and tox environments
- Created stub implementations for cameras and DLCLive to enable hardware-free testing
- Implemented end-to-end GUI tests for preview and inference workflows
Reviewed changes
Copilot reviewed 59 out of 60 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tox.ini | Configures tox test environments for different Python versions and test suites |
| setup.py | Updates package metadata and dependencies for v2.0 |
| pyproject.toml | Adds modern build system configuration with pytest settings |
| docs/*.md | Comprehensive documentation for user guide, features, camera backends, and timestamp format |
| dlclivegui_tests/conftest.py | Central test configuration with fixtures for cameras, DLCLive, and GUI components |
| dlclivegui_tests/fixtures/*.py | Stub implementations for testing without hardware |
| dlclivegui_tests/tests_fixtures/*.py | Integration tests for test fixtures |
| dlclivegui_tests/test_gui/test_end_to_end.py | Functional GUI tests for preview and inference |
| dlclivegui/*.py | Core application files (video_recorder, dlc_processor, multi_camera_controller, config, cameras) |
| .pre-commit-config.yaml | Pre-commit hooks for code formatting |
| .github/workflows/*.yml | CI/CD workflows for testing and formatting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sets up an end-to-end testing pipeline for basic GUI functions.
Currently uses fixtures for cameras and DLCLive, while testing:
MultiCameraControllerDLCProcessorgui.MainWindowNOTE
guiandfunctionalmainly), please let me know if they would be best used differently or if you have a different classification in mind.toxCI installs dependencies separately right now. This is mostly to avoid tensorflow binaries issues when testing on Windows, but this may not be what we want long-term.TODO:
*tests**field in.gitignoreis still in use, otherwise we can rename the folder to something more standard